/* -----------------------------------------------------------------------
 * Demonstration of how to write unit tests for dominion-base
 * Include the following lines in your makefile:
 *
 * unittest2: unittest2.c dominion.o rngs.o
 *      gcc -o testUpdateCoins -g  unittest2.c dominion.o rngs.o $(CFLAGS)
 * -----------------------------------------------------------------------
 */

#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

int main() {
	//testing scoreFor
	struct gameState G;
	int i;
	int numPlayer = 2;
	int seed = 2;
	int player = 0;//just player 0 for now
	int k[10] = {adventurer, council_room, feast, gardens, mine
		, remodel, smithy, village, baron, great_hall};
	
	//int r = initializeGame(numPlayer, k, seed, &G); // initialize a new game
	G.handCount[player] = 10; //give ten cards, no discard cards, and no deck cards and make them all curse cards
	G.discardCount[player]=0;
	G.deckCount[player]=0;
	for (i = 0; i < G.handCount[player]; i++)
	{
			G.hand[player][i] = curse;
	}
	int playerScore = scoreFor(player, &G);
	if (playerScore== -10) {
		printf("Passed normal scoring in hand\n");
	}
	else {
		printf("Failed normal scoring in hand\n");
	}

	G.handCount[player] = 0; //give no cards, 10 discard cards, and no deck cards and make them all curse cards
	G.discardCount[player]=10;
	G.deckCount[player]=0;
	for (i = 0; i < G.handCount[player]; i++)
	{
		G.discard[player][i]=curse;
	}
	playerScore = scoreFor(player, &G);
	//printf("%d", playerScore);
	if (playerScore== -10) {
		printf("Passed normal scoring in discard\n");
	}
	else {
		printf("Failed normal scoring in discard\n");
	}
	
	G.handCount[player] = 0; //give no cards, 0 discard cards, and 10 deck cards and make them all curse cards
	G.discardCount[player]=0;
	G.deckCount[player]=10;
	for (i = 0; i < G.handCount[player]; i++)
	{
		G.deck[player][i]=curse;
	}
	playerScore = scoreFor(player, &G);
	//printf("%d", playerScore);
	if (playerScore== -10) {
		printf("Passed normal scoring in deck\n");
	}
	else {
		printf("Failed normal scoring in deck\n");
	}
	

	//	printf("numPlayers: %d\n",G.numPlayers); //number of players
	
	//  printf("embargoTokens: %d\n",G.embargoTokens[treasure_map+1]);
	//	printf("outpostPlayed: %d\n",G.outpostPlayed);
	//	printf("outpostTurn: %d\n",G.outpostTurn);
	//	printf("whoseTurn: %d\n",G.whoseTurn);
	//	printf("whoseTurn: %d\n",G.phase);
	//	printf("numActions: %d\n",G.numActions); /* Starts at 1 each turn */
	//	printf("coins: %d\n",G.coins); /* Use as you see fit! */
	//	printf("numBuys: %d\n",G.numBuys); /* Starts at 1 each turn */
	//	printf("hand: %d\n",G.hand[MAX_PLAYERS][MAX_HAND]);
	//	printf("handCount: %d\n",G.handCount[MAX_PLAYERS]);
	//	printf("deck: %d\n",G.deck[MAX_PLAYERS][MAX_DECK]);
	//	printf("deckCount: %d\n",G.deckCount[MAX_PLAYERS]);
	//	printf("discard: %d\n",G.discard[MAX_PLAYERS][MAX_DECK]);
	//	printf("discardCount: %d\n",G.discardCount[MAX_PLAYERS]);
	//	printf("playedCards: %d\n",G.playedCards[MAX_DECK]);
	//	printf("playedCardCount: %d\n",G.playedCardCount);

	
	return 0;
}
